/*
 * @author yjiewei
 * @date 2022/2/13 15:34
 */
package com.woniuxy;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class Author implements Comparable<Author>{
    private Integer aid;
    private String aname;
    private Integer age;
    private List<Book> books;

    @Override
    public int compareTo(Author o) {
        return o.getAge() - this.getAge();
    }
}
